package book;

import javax.xml.bind.annotation.XmlType;
import java.util.Arrays;


public class BookLIst {
      private Book[] books;//存放书籍
      private static final int DEFAULT = 10;
      private int usedSize;
      public BookLIst() {
          this.books = new Book[DEFAULT];
          this.books[0] = new Book("三国演义","罗贯中",19,"武侠");
          this.books[1] = new Book("西游记","吴承恩",20,"神话");
          this.books[2] = new Book("红楼梦","曹雪芹",15,"小说");
          this.usedSize = 3;

      }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    public Book[] getBooks() {
        return books;
    }

    public void setBooks(Book[] books) {
        this.books = books;
    }
    public Book getBook(int id) {
          return books[id];
    }
    public void setBookList(int id, Book book) {
          books[id] = book;
    }

}
